package File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class Dome6 {
    public static void main(String[] args) {
        InputStream inputStream = null;
        try{
            inputStream = new FileInputStream("d:/test.txt");
            while(true) {
                int b = inputStream.read();
                if(b == -1) {
                    break;//文件读取结束
                }
                System.out.printf("0X%X",b);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
